<?php

namespace app\api\controller;

use app\common\controller\Api;
use fast\Http;
use fast\Random;
use app\api\service\CouponService;

/**
 * 优惠卷接口
 */
class Coupon extends Api
{

    // 无需登录的接口,*表示全部
    protected $noNeedLogin = [];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];



    /**
     * 领取优惠卷
     *
     */
    public function collect_coupon()
    {
        $data = $this->request->post();
        $res = CouponService::collectCoupon($data);
        return json($res);
    }

    /**
     * 领取优惠卷
     *
     */
    public function my_coupon()
    {
        $data = $this->request->post();
        $res = CouponService::getMyCouponLists($data);
        return json($res);
    }

}
